<!DOCTYPE html>
<html lang="en" xmlns:dataTable>
<head>
	<meta charset="UTF-8">
	<title>合同明细查询</title>
	<link rel="stylesheet" href="css/reset.css">
	<link rel="stylesheet" href="css/product.css">
	<link rel="stylesheet" href="css/select.css">
	<style>
		.content-table-three tbody tr td {
		    max-width: 350px;
		    min-width: 100px;
		}
		.content-table-three thead tr td span {
	    	color: #4d5971;
		    display: inline-block;
		    word-wrap: break-word;
		    width: 125px;
		    line-height: 20px;
		    vertical-align: top;
		    margin-top: 10px;
		}
		.content-table-three tbody tr td p {
		    text-align: right;
		    padding-left: 12px;
		}
		.content-table-three tbody tr td span{
			padding-right: 12px;
		}
		.content-table-three thead tr td:nth-child(2) span {
		    color: #4d5971;
		    display: inline-block;
		    word-wrap: break-word;
		    width: 300px;
		    line-height: 20px;
		    vertical-align: top;
		    margin-top: 10px;
		}
		.content-table-three thead tr td:last-child {
		    line-height: 40px;
		    background: #F9FBFF;
		    text-align: right;
		    padding-right: 12px;
		}
		.content-table-three thead tr td:last-child span {
		    color: #4d5971;
		    display: inline-block;
		    width: auto;
		    line-height: 20px;
		    vertical-align: top;
		    margin-top: 10px;
		}
		.content-table-three tbody tr td:nth-child(1){
			width: 200px;
		}
		.content-table-three tbody tr td:nth-child(2){
			width: 150px;
		}
		.content-table-three tbody tr td:nth-child(3){
			width: 205px;
		}
		.content-table-three tbody tr td:nth-child(4){
			width: 225px;
		}
		.content-table-three tbody tr td:nth-child(1) span{
			width: 105px;
		}
		.content-table-three tbody tr td:nth-child(2) span{
			width: 85px;
		}
		.content-table-three tbody tr td:nth-child(3) span{
			width: 145px;
		}
		.content-table-three tbody tr td:nth-child(4) span{
			width: 145px;
		}
		.content-table-three tbody tr:nth-child(2) td p{
			text-align: left;
		}
		.content-table-three tbody tr:nth-child(2) td p>span{
			width: auto;
		}
		.content-table-three tbody tr td:last-child {
			width: 120px !important;
			min-width: 120px;
			line-height: 30px;
			border: 1px solid #ecf2f7;
			padding-bottom: 10px;
			padding-top: 10px;
			text-align: center;
			/* padding-right: 12px; */
		}
		.layui-layer-content>p{
			line-height: 30px;
		    padding: 30px;
		    text-align: center;
	    }
	    .content-form ul li > .laydate-icon{
		    padding-left: 12px !important;
		}
		.color-operation:hover {
		    text-decoration:underline; 
		    cursor: pointer;
		}
	</style>
</head>
<body>
	<div class="main-content">
		<div class="main-bg">
			<p class="content-title">合同明细查询</p>
			<form id = "contractDetail">
				<div class="content-form">
					<ul>
						<li><span class="text-name">项目名称：</span><input type="text" name = "projectname"></li>
						<li><span class="text-name">部门名称：</span><input type="text" name = "department"></li>
						<li><span class="text-name">合同状态：</span>
						<select class="multiselect" id="single" name = "status">
							<option value="0">已入库</option>
							<option value="1">配送中</option>
							<option value="2">已签收</option>
							<option value="3">已分发</option>
							<option value="4">已回寄</option>
							<option value="5">已入档</option>
							<option value="6">已作废</option>
							<option value="7">调配中</option>
							<option value="8">已调配</option>
							<option value="9">退回中</option>
							<option value="10">已退回</option>
							<option value="11">已经配送认购书</option>
							<option value="12">认购书已签收</option>
						</select>
						<li><span class="text-name">纸质合同编号：</span><input type="text" name = "contractcode"></li>
						<li><span class="text-name">确认书发放状态：</span>
						<select class="multiselect" id="single1" name = "confirtrackstatus">
							<option value="0">未录入</option>
							<option value="1">已录入</option>
							<option value="2">审核通过</option>
							<option value="3">审核拒绝</option>
						</select></li>
						<li><span class="text-name">客户名称：</span><input type="text" name = "custname"></li>
						<li><span class="text-name">配送快递单号：</span><input type="text" name = "tracknumber"></li>
						<li><span class="text-name">回寄快递单号：</span><input type="text" name = "returntracknumber"></li>
						<li><button class="btn-style-two" id = "search" onclick = "return false">搜索</button><i class="btn-operation maleft20">重置</i></li>
					</ul>
				</div>
			</form>
			
			<div class="content-list"> 
				<div class="info-list" dataTableTable = "true" bindForm="contractDetail" bindClick = "search" dataAction = "/contractDetail/findList">
					<table class="content-table-three" cellspacing="0" cellpadding="0">
						<thead>
							<tr>
								<td>项目编号：<span type = "table" name = "projectcode"></span></td>
								<td colspan="2">项目名称：<span type = "table" name = "projectname"></span></td>
								<td>分发时间：<span type = "table" name = "issuedate"></span></td>
								<td></td>
							</tr>
						</thead>
						<tbody>
							<tr>
								<td>
									<p>纸质合同编号：<span type = "table" name = "contractcode"></span></p>
									<p>确认书配送状态：<span type = "table" name = "confirtrackstatus" dataType = "dict" dictType = "confirtrackstatus"></span></p>
									<p>预约状态：<span type = "table" name = "confirtrackstatus"></span></p>
								</td>
								<td>
									<p>客户编号：<span type = "table" name = "custcode" dataType = "string"></span></p>
									<p>客户名称：<span type = "table" name = "custname"></span></p>
								</td>
								<td>
									<p>理顾姓名：<span type = "table" name = "isname"></span></p>
									<p>所属部门：<span type = "table" name = "department"></span></p>
								</td>
								<td>
									<p>合同状态：<span type = "table" dataType = "dict" dictType = "contractstatus" name = "status"></span></p>
									<p>配送快递单号：<span type = "table" name = "tracknumber" class="color-operation" onclick="seeLogistics(this)"></span></p>
									<p>回寄快递单号：<span type = "table" name = "returntracknumber" class="color-operation" onclick="seeLogistics(this)"></span></p>
								</td>
								<td>
									<i class="btn-operation" onclick="stateChangeFlow(this)">状态变更流水</i>
									<i class="btn-operation" onclick="cancel(this)">纸质合同作废</i>
								</td>
							</tr>
							<tr>
								<td colspan="5">
									<p>备注：<span type = "table" name = "remark"></span></p>
								</td>
							</tr>
						</tbody>
					</table>
				</div>
			</div>
		</div>
	</div>
	<script src="js/jquery-3.2.1.min.js"></script>
	<script type="text/javascript" src="lib/layer/2.4/layer.js"></script>
	<script src="js/select.jquery.js"></script>
	<script type="text/javascript" src = "js/util.js"></script>
	<script type="text/javascript" src = "js/tableTable.js"></script>
	<script type="text/javascript" src = "js/allProduct.js"></script>
    <script type="text/javascript">
        $(document).ready(function (){//新增
			$('.multiselect').multiselect({setMaxOptionNum:4,selectedHtmlValue:''});
			$('#single').multiselect({multiple:false,selectedHtmlValue:'全部',setWidth: 140+'px'});
			$('#single1').multiselect({multiple:false,selectedHtmlValue:'全部',setWidth: 140+'px'});
			$('.main-content').resize(function(){
                getHeight();
            });
		 });
        function cancel(my){
        	my = $(my);
        	var index = my.parent().parent().parent().parent().find("input[name='index']").val();
        	var data = $("div[dataTableTable = 'true']").getAllTableData()[index];
        	var param = new FormData();
        	param.append("id",data.id);
        	param.append("status","6");
        	parent.layer.confirm('确定作废当前合同么？', {
				btn: ['确定','取消'] //按钮
			}, function(){
				$.ajax({
			        type: 'post',
			        url:baseUrl + "/contractDetail/update",
			        contentType: false,  
			        processData: false, 
			        async: false,
			        data:param
				}).done(function(dt){
					parent.layer.closeAll();
					$("div[dataTableTable = 'true']").ECDATableTable();
				});
			},function(){
				parent.layer.closeAll();
			});
        }
        function stateChangeFlow(my){
        	my = $(my);
        	var index = my.parent().parent().parent().parent().find("input[name='index']").val();
        	parent.setData($("div[dataTableTable = 'true']").getAllTableData()[index]);
        	parent.layer.open({
				type: 2,
				title: '状态变更流水',
				shadeClose: true,
				shade: 0.2,
				maxmin: true, //开启最大化最小化按钮
				area: ['870px', '450px'],
				content: 'stateChangeFlow.html'
			});
        };

        function seeLogistics(){
        	parent.layer.open({
				type: 2,
				title: '查看物流',
				shadeClose: true,
				shade: 0.2,
				maxmin: true, //开启最大化最小化按钮
				area: ['870px', '450px'],
				content: 'seeLogistics.html'
		    });
        }
		function tableCallBack (my){
			$.each(my.find("table"),function(index){
				var $this = $(this);
	        	var data = $("div[dataTableTable = 'true']").getAllTableData()[index];
	        	console.log(data);
	        	return;
				if(data.status == 1){
					$this.find("tbody").find("tr").eq(0).find("td").eq(4).find("i").eq(1).remove();
				}
			})
		}
		function getHeight(){
            var myiframeH=$(".main-content").height();
            var _parent=$(window.parent.document);
            _parent.find('body').css('height',(myiframeH+150)+'px');
            _parent.find('.main-position').css('height',(myiframeH+100)+'px');
        };
	</script>

</body>
</html>